package types

const (
	Start   = "start"
	End     = "end"
	Confirm = "confirm"
	// CaloModelId 校准仪 物模型ID.
	CaloModelId = "m_calo"

	// ZeroCalibrate 零气校准.
	ZeroCalibrate = "ZeroCalibrate"
	// CancelZeroCalibrate 取消跨度校准.
	CancelZeroCalibrate = "CancelSpanCalibrate"
	// ConfirmZeroCalibrate 确认跨度校准.
	ConfirmZeroCalibrate = "ConfirmSpanCalibrate"

	// SpanCalibrate 跨度校准.
	SpanCalibrate = "SpanCalibrate"
	// CancelSpanCalibrate 取消跨度校准.
	CancelSpanCalibrate = "CancelSpanCalibrate"
	// ConfirmSpanCalibrate 确认跨度校准.
	ConfirmSpanCalibrate = "ConfirmSpanCalibrate"
	// CaliFlow 校准仪流量.
	CaliFlow = "4000"

	// IndicationError 示值误差.
	IndicationError = "IndicationError"
	// LinearityError 线性误差.
	LinearityError = "LinearityError"
	// Precision 精密度.
	Precision = "Precision"
	//ZeroPointNoise 零点噪声.
	ZeroPointNoise = "ZeroPointNoise"
	//RangeNoise 量程噪声
	RangeNoise = "RangeNoise"
	//ZeroDriftAndSpanDrift 24H零点漂移和量程漂移
	ZeroDriftAndSpanDrift = "ZeroDriftAndSpanDrift"
)

var (
	//onvif
	GetProfiles      = "GetProfiles"
	SetProfile       = "SetProfile"
	ContinuousMove   = "ContinuousMove"
	RelativeZoomMove = "RelativeZoomMove"
	StopMove         = "StopMove"
	GetPresets       = "GetPresets"
	SetPreset        = "SetPreset"
	RemovePreset     = "RemovePreset"
	GotoPreset       = "GotoPreset"
	FocusMove        = "FocusMove"

	//门禁
	AccessControlOpen  = "Open"
	AccessControlClose = "Close"
	FanSwitch          = "control"     //开关 status 0 关闭 1开启.
	AudibleAlarm       = "control"     //声光报警器
	GateAddPerson      = "addperson"   //添加人员
	GateDelPerson      = "delperson"   //删除人员
	GateQueryPerson    = "queryperson" //查询人员
	GateDelCard        = "delcard"     //删除卡片
	QueryCard          = "querycard"   //查询人员

	//AIDI                    = "DO1"      // status 0 关闭 1开启.
	AirConditioningSwitch   = "status"   // 空调开关.
	AirConditioningDispatch = "dispatch" // 空调下发指令.

	// Status 气体状态.
	Status = "status"

	TaskCaliType = []string{
		IndicationError,
		LinearityError,
		Precision,
		RangeNoise,
		ZeroPointNoise,
		ZeroDriftAndSpanDrift,
	}
	SwitchService = map[string]string{
		"m_wind":        FanSwitch,
		"m_alarm_light": AudibleAlarm,
	}
)

func GetUnit(modelId string) string {
	if modelId == "m_co" {
		return "PPM"
	} else {
		return "PPB"
	}
}

func IsZero(gasType string) int {
	if gasType == ZeroCalibrate {
		return 0
	}
	return 1
}

//零气校准，和跨度校准，计划任务可以传溶度.

func IsCali(gasType string) bool {
	if gasType == ZeroCalibrate || gasType == SpanCalibrate {
		return true
	}
	return false
}

//IndicationError: {
//"1": CaliParams{GasType: 0, Number: 0, Ext: 5 * 60, Unit: "PPB"},
//"2": CaliParams{GasType: 0, Number: 250, Ext: 30 * 60, Unit: "PPB"},
//"3": CaliParams{GasType: 0, Number: 250, Ext: 30 * 60, Unit: "PPB"},
//"4": CaliParams{GasType: 0, Number: 250, Ext: 30 * 60, Unit: "PPB"},
//},
